<script setup lang="ts">
import {computed, defineEmits, reactive} from "vue";

let emit = defineEmits(['update:modelValue'])
//定义对外的属性名
const props = defineProps({
  modelValue: {
    type: String,
  }
})
//数据源
const data = reactive({
  inputValue: '',
})
//
const computedValue = computed({
    get() {
      return props.modelValue;
    },
    set(value) {
      emit('update:modelValue', value)
    }
  }
)
</script>

<template>
  <div class="test-view ver-layout">
    <div>子组件</div>
    <van-field v-model="computedValue"></van-field>
  </div>
</template>

<style lang="less">
.test-view {
  padding: 10px;
  background: #de9494;
}
</style>
